﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace project.MainClasses
{
    public class User
    {
        int id_user;
        string name;
        string login;
        string pass;
        string email;
        char sex;
        Role role;
        void User() {
            this.id_user=0;
            this.name = "";
            this.login = "";
            this.pass = "";
            this.email = "";
            this.sex = '\0';
        }
        void SetID(int i) { this.id_user = i; }
        void SetName( string a) { this.name = a;}
        void SetLogin(string b) { this.login = b;}
        void SetPass(string c) { this.pass = c; }
        void SetEmail(string d) { this.email = d;}
        void SetSex(char e) { this.sex = e; }
        void SetRole(Role r) { this.role = r; }
        int GetID() { return this.id_user; }    
        string GetName() { return this.name; }        
        string GetLogin() { return this.login;}        
        string GetPass() { return this.pass;}        
        string GetEmail() { return this.email; }
        char GetSex() { return this.sex; }
        Role GetRole() { return this.role; }
  

        User add(int id, string a1,string a2,string a3,string a4, char a5, Role role) {
            User us = new User();
            us.id_user = id;
            us.SetName(a1);
            us.SetLogin(a2);
            us.SetPass(a3);
            us.SetEmail(a4);
            us.SetSex(a5);
            us.SetRole(role);
            return us;
        }
        void edit(User usr, int i1, string b1, string b2, string b3, string b4, char b5, Role role1) {
            usr.SetID(i1);
            usr.SetName(b1);
            usr.SetLogin(b2);
            usr.SetPass(b3);
            usr.SetEmail(b4);
            usr.SetSex(b5);
            usr.SetRole(role1);
        }
        User del(User aaa)
        {
            aaa.id_user = 0;
            aaa.name = "";
            aaa.login = "";
            aaa.pass = "";
            aaa.email = "";
            aaa.sex = '\0';
            return aaa;
        }
        void selectByDepartment() { }
        void selectByRole() { }
    }
}